mini.parse();

function login() {
	var loginName = $("#loginName").val();
	if (loginName == null || loginName.trim().length == 0) {
		mini.alert("登录名不能为空！");
		return;
	}
	var password = $("#password").val();
	if (password == null || password.trim().length == 0) {
		mini.alert("密码不能为空！");
		return;
	}
	mini.mask({
        el: document.body,
        cls: 'mini-mask-loading',
        html: '正在登录...'
    }); 
	$.ajax({
		//url : projectName+"/OfficialUsrAdmin/saveStStorage?loginName="+mini.get("loginName").getValue()+"&password="+mini.get("password").getValue(),
		url : $("#projectName").val()+"/OfficialUsrAdmin/login?loginName="+loginName+"&password="+password,
		type : 'post',
		contentType : "application/json; charset=utf-8",
		dataType : 'json',
		cache : false,
		success : function(data) {
			mini.unmask();
			if (data.status == '1') {//页面跳转
				window.location.href=$("#projectName").val()+"/officialMain/manage";
			} else if(data.status == '0') {
				mini.alert(data.message);
			} else {
				mini.alert("发生错误!");
			}
		},
		error : function(jqXHR, textStatus, errorThrown) {
		    mini.unmask();
			mini.alert(jqXHR.responseText);
		}
	});
}